package han.chensing.latos.maker.container;

import com.badlogic.gdx.graphics.Camera;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.glutils.ShaderProgram;
import com.badlogic.gdx.scenes.scene2d.Stage;

public class CirnoStage extends Stage {
    ShaderProgram smoothShader;

    public void setSmoothShader(ShaderProgram smoothShader) {
        this.smoothShader = smoothShader;
    }

    @Override
    public void draw() {
        Camera camera = getViewport().getCamera();
        camera.update();

        if (!getRoot().isVisible()) return;

        Batch batch = this.getBatch();
        batch.setProjectionMatrix(camera.combined);
        batch.begin();
        batch.setShader(smoothShader);
        getRoot().draw(batch, 1);
        batch.end();
    }
}
